<?php
//passwordField, textField, 

echo Virgo::renderWidget('FormView', array(
    'data' => $model,
    'head' => array(
        'icon' => 'icos-pencil3',
        'title' => $title,
    ),
    'fields' => array(
        'city_id' => array(
            'type' => 'dropDownList',
            'htmlOptions' => array(
                'empty' => 'Выберите ...',
            ),
            'data' => CHtml::listData(City::model()->getActiveCity(), 'id', 'name'),
        ),
        'street' => array(
            'type' => 'textField',
            'htmlOptions' => array(
                'placeholder' => 'ул.Мира',
            ),
        ),
        'home' => array(
            'type' => 'textField',
            'htmlOptions' => array(
                'placeholder' => '43Б',
            ),
        ),
        'korp' => array(
            'type' => 'textField',
            'htmlOptions' => array(
                'placeholder' => '2',
            ),
        ),
//        'lat' => array(
//            'type' => 'textField',
//            'htmlOptions' => array(),
//        ),
//        'lng' => array(
//            'type' => 'textField',
//            'htmlOptions' => array(),
//        ),
        'type_id' => array(
            'type' => 'dropDownList',
            'htmlOptions' => array(
                'empty' => 'Выберите ...',
            ),
            'data' => Flat::getTypeFlat(),
        ),
        'repair_id' => array(
            'type' => 'dropDownList',
            'htmlOptions' => array(
                'empty' => 'Выберите ...',
            ),
            'data' => Flat::getRepair(),
        ),
        'guests' => array(
            'type' => 'dropDownList',
            'htmlOptions' => array(
                'empty' => 'Выберите ...',
            ),
            'data' => Flat::getSleeper(),
        ),
        'sleeper' => array(
            'type' => 'textField',
            'htmlOptions' => array(
                'placeholder' => '2+2+1',
            ),
        ),
        'price' => array(
            'type' => 'textField',
            'htmlOptions' => array(
                'placeholder' => '300',
            ),
        ),
        'description' => array(
            'type' => 'textArea',
            'htmlOptions' => array(
                'placeholder' => 'Введите описание',
            ),
        ),
        'infrastructure' => array(
            'type' => 'textArea',
            'htmlOptions' => array(
                'placeholder' => 'Что находится рядом',
            ),
        ),
        'furniture' => array(
            'type' => 'textArea',
            'htmlOptions' => array(
                'placeholder' => 'Перечислите всю мебель через запятую',
            ),
        ),
        'pubSocialNetworks' => array(
            'type' => 'checkbox',
            'title' => ' ',
            'desription' => 'Публиковать в соц.сетях',
            'htmlOptions' => array(),
        ),
        'is_active' => array(
            'type' => 'dropDownList',
            'htmlOptions' => array(
                'empty' => 'Выберите ...',
            ),
            'data' => Flat::getTextStatus(),
        ),
    )
));
?>

<div class="widget">
    <div class="head dark">
        <div class="icon"><span class="icos-picture"></span></div>
        <h2>Фото</h2>                    
    </div>                           
    <div class="sGallery clearfix">
        <?php for ($i = 0; $i < 8; $i++) { ?>
            <?php $field = 'img' . $i; ?>

            <div class="item">
                <?php if (!empty($model->{$field})) { ?>
                    <a href="/data/imgs/flat/<?= $model->id; ?>/<?= $model->{$field} ; ?>" class="fb" rel="group"><?= ImageResizer::getThumb($model->{$field}, 'data/imgs/flat/' . $model->id . '/', $model->{$field}, 220, 137) ?></a>
                <?php } else { ?>
                    <a href="/data/imgs/flat/noimg.gif" class="fb" rel="group"><img src="/data/imgs/flat/noimg.gif" width="220"/></a>
                    <?php } ?>
            </div>   
        <?php } ?>
    </div>
</div>
